package architect.design.patterns.behavior.command;

/**
 * 文件系统接收器工具
 *
 * @author guanxin
 * @date 2018/5/6 13:34
 */

public class FileSystemReceiverUtil {

    public static FileSystemReceiver getUnderlyingFileSystem() {
        String osName = System.getProperty("os.name");
        System.out.println("Underlying OS is : " + osName);

        if (osName.contains("Windows")) {
            return new WindowsFileSystemReceiver();
        } else {
            return new UnixFileSystemReceiver();
        }
    }
}
